namespace XRM.Security.DataAccess.Context
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class IdentityCenterInfoSystemNormal : DbMigration
    {
        public override void Up()
        {
            Sql("delete from IdentityCenterInfoSystem");
            DropPrimaryKey("dbo.IdentityCenterInfoSystem");
            AddColumn("dbo.IdentityCenterInfoSystem", "InfoSystemId", c => c.Int(nullable: false));
            AddPrimaryKey("dbo.IdentityCenterInfoSystem", new[] { "InfoSystemId", "IdentityCenterId" });
            CreateIndex("dbo.IdentityCenterInfoSystem", "InfoSystemId");
            AddForeignKey("dbo.IdentityCenterInfoSystem", "InfoSystemId", "dbo.InfoSystem", "InfoSystemId", cascadeDelete: true);
            DropColumn("dbo.IdentityCenterInfoSystem", "IdentityCenterInfoSystemId");
            DropColumn("dbo.IdentityCenterInfoSystem", "IdentityCenterInfoSystemName");
        }
        
        public override void Down()
        {
            AddColumn("dbo.IdentityCenterInfoSystem", "IdentityCenterInfoSystemName", c => c.String(nullable: false, maxLength: 100));
            AddColumn("dbo.IdentityCenterInfoSystem", "IdentityCenterInfoSystemId", c => c.Int(nullable: false, identity: true));
            DropForeignKey("dbo.IdentityCenterInfoSystem", "InfoSystemId", "dbo.InfoSystem");
            DropIndex("dbo.IdentityCenterInfoSystem", new[] { "InfoSystemId" });
            DropPrimaryKey("dbo.IdentityCenterInfoSystem");
            DropColumn("dbo.IdentityCenterInfoSystem", "InfoSystemId");
            AddPrimaryKey("dbo.IdentityCenterInfoSystem", "IdentityCenterInfoSystemId");
        }
    }
}
